import java.util.StringTokenizer;
import java.util.Vector;

class P478 {

	static final int circle = 99;

	static final int rect = 114;

	static final int tria = 116;


	public static void main(String[] args) {

		Vector figures = new Vector();
		String line = readLn();
		while (!line.equals("*")) {
			StringTokenizer st = new StringTokenizer(line);
			int type = (int) st.nextToken().charAt(0);
			double[] array = null;
			switch (type) {
			case rect:
				double uLx = new Double(st.nextToken()).doubleValue();
				double uLy = new Double(st.nextToken()).doubleValue();
				double lRx = new Double(st.nextToken()).doubleValue();
				double lRy = new Double(st.nextToken()).doubleValue();

				array = new double[5];

				array[0] = rect;
				array[1] = uLx;
				array[2] = uLy;
				array[3] = lRx;
				array[4] = lRy;
				figures.addElement(array);
				break;
			case circle:
				double x0 = new Double(st.nextToken()).doubleValue();
				double y0 = new Double(st.nextToken()).doubleValue();
				double c = new Double(st.nextToken()).doubleValue();

				array = new double[4];
				array[0] = circle;
				array[1] = x0;
				array[2] = y0;
				array[3] = c;
				figures.addElement(array);
				break;

			case tria:
				double x1 = new Double(st.nextToken()).doubleValue();
				double y1 = new Double(st.nextToken()).doubleValue();
				double x2 = new Double(st.nextToken()).doubleValue();
				double y2 = new Double(st.nextToken()).doubleValue();
				double x3 = new Double(st.nextToken()).doubleValue();
				double y3 = new Double(st.nextToken()).doubleValue();

				array = new double[7];
				array[0] = tria;
				array[1] = x1;
				array[2] = y1;
				array[3] = x2;
				array[4] = y2;
				array[5] = x3;
				array[6] = y3;
				figures.addElement(array);
				break;

			}

			line = readLn();
		}
		line = readLn();
		int counter = 1;
		while (!line.equals("9999.9 9999.9")) {
			StringTokenizer st1 = new StringTokenizer(line);
			double x = new Double(st1.nextToken()).doubleValue();
			double y = new Double(st1.nextToken()).doubleValue();
			process(counter, x, y, figures);
			counter++;
			line = readLn();
		}
	}


	private static void process(int counter, double x, double y, Vector figures) {
		boolean insideOne = false;
		for (int k = 0; k < figures.size(); k++) {
			if (isInside(x, y, (double[]) figures.elementAt(k))) {
				System.out.println("Point " + counter + " is contained in figure " + (k + 1));
				insideOne = true;
			}
		}
		if (!insideOne) {
			System.out.println("Point " + counter + " is not contained in any figure");
		}
	}


	private static boolean isInside(double x, double y, double[] ds) {
		switch ((int) ds[0]) {
		case rect:
			double uLx = ds[1];
			double uLy = ds[2];
			double lRx = ds[3];
			double lRy = ds[4];
			return x > uLx && x < lRx && y > lRy && y < uLy;
		case circle:
			double x0 = ds[1];
			double y0 = ds[2];
			double c = ds[3];
			return Math.pow(x - x0, 2) + Math.pow(y - y0, 2) < Math.pow(c, 2);
		case tria:
			double x1 = ds[1];
			double y1 = ds[2];
			double x2 = ds[3];
			double y2 = ds[4];
			double x3 = ds[5];
			double y3 = ds[6];
			
			double a1 = triang_area(x1, y1, x2, y2, x, y);
			double a2 = triang_area(x, y, x2, y2, x3, y3);
			double a3 = triang_area(x1, y1, x, y, x3, y3);
			double a4 = triang_area(x1, y1, x2, y2, x3, y3);
			
			return Math.abs(a1 + a2 + a3 - a4) <= 0.000001;
		}
		return false;
	}

	
	private static double triang_area(double x0, double y0, double x1, double y1, double x2, double y2) {
		double answer = Math.abs((x1-x0)*(y2-y0)-(x2-x0)*(y1-y0));   
		return answer;
	}


	static String readLn() {
		String newLine = System.getProperty("line.separator");
		StringBuffer buffer = new StringBuffer();
		int car = -1;
		try {
			car = System.in.read();
			while ((car > 0) && (car != newLine.charAt(0))) {
				buffer.append((char) car);
				car = System.in.read();
			}
			if (car == newLine.charAt(0))
				System.in.skip(newLine.length() - 1);
		} catch (java.io.IOException e) {
			return (null);
		}
		if ((car < 0) && (buffer.length() == 0))
			return (null);
		return (buffer.toString()).trim();
	}

}
